<template>
    <el-collapse-item v-if="enable" :name="name">
    <template #title>
        <span style="padding-left:20px">
          执行监听器<el-icon class="header-icon"><info-filled /></el-icon>
        </span>
     </template>
     <ExecuteAction
          :element="element"
          :bpmnModeler="bpmnModeler"
        />
  </el-collapse-item>
</template>
<script>
 import ExecuteAction from './parts/ExecuteAction.vue'
 import { is } from 'jeeplus-bpmn/lib/util/ModelUtil'

export default {
   props: {
     element: {
       type: Object,
       default: undefined
     },
     bpmnModeler: {
       type: Object,
       default: undefined
     },
     name: ''
   },
   data () {
     return {
       allowedIn: ['bpmn:Task',
         'bpmn:ServiceTask',
         'bpmn:UserTask',
         'bpmn:BusinessRuleTask',
         'bpmn:ScriptTask',
         'bpmn:ReceiveTask',
         'bpmn:ManualTask',
        //  'bpmn:ExclusiveGateway',
         'bpmn:SequenceFlow',
        //  'bpmn:ParallelGateway',
        //  'bpmn:InclusiveGateway',
        //  'bpmn:EventBasedGateway',
         'bpmn:StartEvent',
         'bpmn:IntermediateCatchEvent',
         'bpmn:IntermediateThrowEvent',
         'bpmn:EndEvent',
         'bpmn:BoundaryEvent',
         'bpmn:CallActivity',
         'bpmn:SubProcess',
         'bpmn:Process']
     }
   },
   components: {
     ExecuteAction
   },
   computed: {
     enable () {
       let enable = false
       this.allowedIn.forEach((item) => {
         if (is(this.element, item)) {
           enable = true
         }
       })
       return enable
     }
   },
   methods: {

   }
}
</script>